fix: support custom directive definitions in schema codegen (option 1, ignoring)#4090
fix: support custom directive definitions in schema codegen (option 1, ignoring)#4090magicmark wants to merge 1 commit intostrawberry-graphql:mainfrom
Conversation
Previously, schemas containing custom directive definitions would fail with `NotImplementedError: Unknown definition None`. Now directive definitions are gracefully skipped since they don't require code generation. Also fixes the error message for unknown definitions to show the actual type name instead of `None`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Reviewer's GuideUpdates schema code generation to ignore custom directive definitions that don’t require codegen and improves error reporting for unsupported GraphQL definition nodes, along with a focused test and release-note update. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4090 +/- ##
=======================================
Coverage 94.22% 94.23%
=======================================
Files 541 541
Lines 35519 35521 +2
Branches 1877 1878 +1
=======================================
+ Hits 33469 33473 +4
+ Misses 1739 1737 -2
Partials 311 311 🚀 New features to boost your workflow:
|
CodSpeed Performance ReportMerging this PR will not alter performanceComparing Summary
|
|
Thanks for adding the Here's a preview of the changelog: This release fixes schema codegen to support custom directive definitions. Previously, schemas containing custom directives like directive @authz(resource: String!, action: String!) on FIELD_DEFINITION
type Query {
hello: String! @authz(resource: "greeting", action: "read")
}This also fixes the error message for truly unknown definition types to show the actual type name instead of Here's the tweet text: |

Description
Previously, schemas containing custom directive definitions would fail with
NotImplementedError: Unknown definition None. Now directive definitions are gracefully skipped.Also fixes the error message for unknown definitions to show the actual type name instead of
None.🤖 Generated with Claude Code
Types of Changes
Issues Fixed or Closed by This PR
Checklist
Summary by Sourcery
Support custom directive definitions in schema code generation and clarify errors for unsupported GraphQL definition types.
Bug Fixes:
Documentation:
Tests: